<template>
	<view class="">
		<view class="bg-white p-3"><textarea v-model="feedback" placeholder="请描述您遇到的相关问题(必填)" placeholder-class="placeholder"></textarea></view>
		<view class="bg-white p-3 flex justify-between mt-3">
			<text>联系电话</text>
			<input
				type="number"
				inputmode="numeric"
				maxlength="11"
				placeholder="请输入联系方式,更好的解决问题"
				placeholder-class="placeholder"
				v-model="phone"
				style="width: 70%;"
				class="text-right"
			/>
		</view>
		<view class="p-3 font c_6">感谢您反馈意见和建议，帮助我们成长</view>
		<button class="bg_main fixed-bottom font-md text-white py-1" @click="submit">提交反馈</button>
	</view>
</template>

<script>
import { feedback } from '@/api/my/problem.js';
export default {
	data() {
		return {
			feedback: '',
			phone: ''
		};
	},
	methods: {
		submit() {
			if (!this.feedback) {
				uni.$u.toast('请描述您遇到的相关问题');
				return;
			}
			let msg = {
				feedback: this.feedback,
				phone: this.phone,
				token: uni.getStorageSync('userInfo').token || ''
			};
			feedback(msg).then(res => {
				// console.log(res);
				uni.$u.toast(res.msg);
			});
		}
	}
};
</script>

<style lang="scss" scoped>
/deep/.placeholder {
	color: #999;
}
</style>
